Context-Based Adaptive Binary Arithmetic Coding (CABAC) is one of the two entropy-coding schemes adopted in the International video coding standard H.264, and has higher compressive efficiency than the other entropy-coding scheme, namely Context-based Adaptive Variable Length Coding (CAVLC).
The function of an entropy coder is to code the values of all syntax elements in each macro block (MB) into code streams successively according to the MB scanning order. Here, the MB is a basic unit block for video image coding. Each image to be coded is divided into several MBs and further processed by encoding. The video coding standard H.264 supports two kinds of basic MB scanning orders.
Generally, the CABAC encoding process includes three primary parts, i.e. binarization, selection and update of context probability model, and binary arithmetic coding.
Particularly, the binarization is a pre-processing procedure for the syntax elements prior to encoding. The value of each syntax element is mapped into a binary character string including ‘0’s and ‘1’s according to a certain mapping rule. The mapping rule may vary depending on the nature of syntax elements.
Further, the binary arithmetic coder performs coding on the basis of the probability estimation value PLPS of the bin (the basic bit for CABAC coding and decoding) to be encoded, wherein, the context probability model is defined for the calculation of the PLPS. Concretely, the probability estimation of a bin to be ‘0’or ‘1’ is performed before the bin is encoded. If the probability of ‘0’ is greater than that of ‘1’, the most probable symbol (MPS) is set to ‘0’ and the least probable symbol (LPS) is set to ‘1’; otherwise, MPS is set to ‘1’ and LPS is set to ‘0’. PLPS is the probability estimation value of a bin value being LPS. The range value of PLPS is 0 through 0.5. During the CABAC encoding process, a corresponding context probability model for every bin is set. Each context probability model contains a state value and an MPS value, and the state indicates the PLPS. The information of the adjacent left and top MBs that have been encoded is utilized to calculate the context probability model for the encoding of the bins of the current MB. The calculation rules are detailedly specified in the documents JVT-G050 for H.264 standard, “Draft ITU-T Recommendation H.264 and Draft ISO/IEC 14496-10 AVC” in JVT of ISO/IEC doc, T. Wig, Ed., Pattaya, Thailand, March 2003. It is ready to perform binary arithmetic coding for the bins after the selection of the context probability models.
The basic principle of the binary arithmetic coding process is to encode the source data with a real number between 0 and 1. The length of the real number depends on the probability of the source symbol sequence. Two basic parameters are used during the arithmetic coding process: the probability estimation values of the symbols and the current interval. The detailed encoding method is to set the current interval to [0,1] firstly, and then to encode or decode each bin. The encoding or decoding of each bin repeats the following process: a. subdivide the current interval to several subintervals, the length of each subinterval is proportional to the probability estimation value of each symbol maybe inputted; and b. choose the subinterval corresponding to the symbol that actually occurs as the new current interval.
In the above encoding process, the current interval becomes smaller and smaller because of the recursive interval subdivisions. To keep the calculation precision, a renormalization process is performed whenever the length of the current interval is smaller than 0.5 after the procedure b completes, to ensure the length of the current interval is always bigger than 0.5 when the next symbol is encoded.
The renormalization process is shown as below:                1. calculating the probability value PLPS of the least probable symbol;        2. calculating the coding intervals RLPS and RMPS separately corresponding to the least probable symbol (LPS)) and the most probable symbol (MPS), details as follows:RLPS=Rangei*PLPS;RMPS=Rangei−RLPS;         where, Rangei is the range value of the decoding interval.        3. calculating the new interval value:        If the current input bin is corresponding to the value of LPS, then:Rangei+1=RLPS;Offseti+1=Offseti+RLPS;        where, Offseti is the offset value in decoding process.        If the current input bin is corresponding to the value of MPS, then:Rangei+1=RLPS;        4. updating the probability value RLPS of the least probable symbol LPS;        5. outputing the decoding result, and renormalize the coding interval Rangei+1.        
The CABAC implementation process is carried out with integer precision. Both the lower bound of the current subinterval Offseti and the range of the subinterval Rangei are all in 9 bits integer precision. The renormalization process ensures the 8th bit, the highest bit of Rangei, is always 1.
It is shown from the formula above that the value of Rangei*PLPS is required by the binary arithmetic coder. To decrease the implementation complexity, the value is not directly calculated by the multiplication of the probability value of the least probable symbol PLPS and the Rangei, on the other hand, all the possible values are stored in a 2-dimension table and the expected value is obtained by querying the table. The index of the table includes a 6-bit value STATE and a 2-bit value qCodIRangeIdx. The 6-bit value is got from PLPS which is corresponding to the context probability model, while the 2-bit value is obtained from the 6th and 7th bits of Rangei, that is, the 2 highest bits except the 8th bit. The range of the 6-bit value STATE is from 0 to 63, and the range of the 2-bit value qCodIRangeIdx is from 0 to 3.
After the bin is encoded, the context probability model needs to be updated according to the value of the current bin encoded. The transition of the MPS value takes place only when the current bin is LPS and the state value before encoding is 0. Otherwise, it is kept unchanged. The transition is performed by changing the MPS value from 0 to 1, or from 1 to 0.
The CABAC arithmetic is formally presented in the JVT (ITU-T international video organization MPEG associated group) conference in 2003. So far, the corresponding CABAC decoders are mainly software or software/hardware based decoding structures.
At present there is a software-based CABAC decoder, of which the decoding process is performed by PC according to the arithmetic flow. Therefore, in the software-based CABAC decoder it is CPU that takes on the whole decoding task, which results in awfully slow decoding rate that can't meet the demand of real time applications.
At present there is another solution that provides software/hardware based decoding architecture, wherein, the hardware component contains the hardware architecture to decode a single bin, and in the hardware architecture one cycle one bin is adopted for the decoding of each bin.
It can be shown that the solution with hardware acceleration of one-cycle-one-bin improves the decoding efficiency greatly compared with the above software-based decoding solution.